from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    MedicalArticleViewSet,
    ArticleRecommendationView,
    ArticleDetailView,
    ArticleRecommendationAPIView,
    import_articles_to_es,
    search_articles,
    initialize_medical_vector_db,
    ai_medical_assistant
)

router = DefaultRouter()
router.register(r'articles', MedicalArticleViewSet)

urlpatterns = [
    # 路由器生成的API路由
    path('', include(router.urls)),
    
    # 文章推荐系统接口
    path('article-recommendation/', ArticleRecommendationView.as_view(), name='article-recommendation'),
    path('articles/recommendations/', ArticleRecommendationAPIView.as_view(), name='article-recommendations'),
    
    # 文章详情接口
    path('articles/<int:article_id>/detail/', ArticleDetailView.as_view(), name='article-detail'),
    
    # Elasticsearch相关接口
    path('es/import-articles/', import_articles_to_es, name='import-articles-to-es'),
    path('es/search/', search_articles, name='search-articles'),
    
    # AI医疗助手接口
    path('ai/initialize-vector-db/', initialize_medical_vector_db, name='initialize-medical-vector-db'),
    path('ai/medical-assistant/', ai_medical_assistant, name='ai-medical-assistant'),
] 